﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ucont_oranlar
{
    public partial class Form1 : Form
    {
        //deneme svn
        public Form1()
        {
            InitializeComponent();
            function();
            this.Refresh();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
           
        } 
        private void function()
        {
         mac []maclar;
            string myXMLfile = "maclar.xml";
            DataSet ds = new DataSet();
            try
            {
                ds.ReadXml(myXMLfile);

                DataTable dt = ds.Tables[0];
                int mac_say = dt.Rows.Count;
              
                maclar = new mac[mac_say];
                for (int i = 0; i < mac_say; i++)
                { 
                    maclar[i] = new mac();
                    panel1.Controls.Add(maclar[i]);
                   maclar[i].Visible = true;
                   if (i % 2 == 0)
                   {
                       maclar[i].BackColor = Color.LightGreen;
                   }
                   else
                   {

                       maclar[i].BackColor = Color.Turquoise;
                   }
                   maclar[i].verileri_yukle(dt.Rows[i]);
                    maclar[i].Top = i * 25;
                    maclar[i].Left = 2;
                    #region veri yükle eski
                    //id = dt.Rows[i]["id"].ToString();
                    //tarih = dt.Rows[i]["tarih"].ToString();
                    //saat = dt.Rows[i]["saat"].ToString();
                    //takim1 = dt.Rows[i]["takim1"].ToString();
                    //takim2 = dt.Rows[i]["takim2"].ToString();
                    //ilk_11 = dt.Rows[i]["ilk_11"].ToString();
                    //ilk_21 = dt.Rows[i]["ilk_21"].ToString();
                    //ikinci_12 = dt.Rows[i]["ikinci_12"].ToString();
                    //ikinci_22 = dt.Rows[i]["ikinci_22"].ToString();
                    //golsayi = dt.Rows[i]["golsayi"].ToString();
                    //durum = dt.Rows[i]["durum"].ToString();
                    //bitti = dt.Rows[i]["bitti"].ToString();
                    //num = dt.Rows[i]["num"].ToString();
                    //mac_kodu = dt.Rows[i]["mac_kodu"].ToString();
                    //lig = dt.Rows[i]["lig"].ToString();
                    //mbs = dt.Rows[i]["mbs"].ToString();
                    //ms_1 = dt.Rows[i]["ms_1"].ToString();
                    //ms_0 = dt.Rows[i]["ms_0"].ToString();
                    //ms_2 = dt.Rows[i]["ms_2"].ToString();
                    //alt = dt.Rows[i]["alt"].ToString();
                    //ust = dt.Rows[i]["ust"].ToString();
                    //ilk_1 = dt.Rows[i]["ilk_1"].ToString();
                    //ilk_0 = dt.Rows[i]["ilk_0"].ToString();
                    //ilk_2 = dt.Rows[i]["ilk_2"].ToString();
                    //alt_15 = dt.Rows[i]["alt_15"].ToString();
                    //ust_15 = dt.Rows[i]["ust_15"].ToString();
                    //alt_35 = dt.Rows[i]["alt_35"].ToString();
                    //ust_35 = dt.Rows[i]["ust_35"].ToString();
                    //hk_1 = dt.Rows[i]["hk_1"].ToString();
                    //hk_0 = dt.Rows[i]["hk_0"].ToString();
                    //hk_2 = dt.Rows[i]["hk_2"].ToString();
                    //bro1 = dt.Rows[i]["bro1"].ToString();
                    //bro2 = dt.Rows[i]["bro2"].ToString();
                    //gn_2 = dt.Rows[i]["gn_2"].ToString();
                    //ss_10 = dt.Rows[i]["ss_10"].ToString();
                    //ss_12 = dt.Rows[i]["ss_12"].ToString();
                    //ss_20 = dt.Rows[i]["ss_20"].ToString();
                    //gn = dt.Rows[i]["gn"].ToString();
                    //hkdurum = dt.Rows[i]["hkdurum"].ToString();
                    #endregion
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
           
        }

    }
}
